home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / termnet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-04  |  5.0 KB  |  157 lines

  1. /* Replace normal networking commands */
  2.  
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef TERMWRAP
  7. #ifdef BUILD_LIBC
  8. #ifdef SHAREDIR
  9. /* These are used for including termnet.c functions in libt.so.4 */
  10. /* I don't use __* directly, because __ has special meaning to some compilers... */
  11. #define term_accept     accept
  12. #define x__accept       __accept
  13. #define term_bind       bind
  14. #define x__bind         __bind
  15. #define term_chroot     chroot
  16. #define x__chroot       __chroot
  17. #define term_close      close
  18. #define x__close        __close
  19. #define term_connect    connect
  20. #define x__connect      __connect
  21. #define term_dup        dup
  22. #define x__dup          __dup
  23. #define term_dup2       dup2
  24. #define x__dup2         __dup2
  25. #define term_fcntl      fcntl
  26. #define x__fcntl        __fcntl
  27. #define term_fork       fork
  28. #define x__fork         __fork
  29. #define term_gethostbyname    gethostbyname
  30. #define x__gethostbyname      __gethostbyname
  31. #define term_gethostbyaddr    gethostbyaddr
  32. #define x__gethostbyaddr      __gethostbyaddr
  33. #define term_gethostname      gethostname
  34. #define x__gethostname        __gethostname
  35. #define term_getpeername      getpeername
  36. #define x__getpeername        __getpeername
  37. #define term_getsockname      getsockname
  38. #define x__getsockname        __getsockname
  39. #define term_listen   listen
  40. #define x__listen     __listen
  41. #define term_perror   _IO_perror
  42. #define __perror      ___IO_perror
  43. #define x__perror     ___IO_perror
  44. #define term_rcmd     rcmd
  45. #define x__rcmd       __rcmd
  46. #define term_recv     recv
  47. #define x__recv       __recv
  48. #define term_recvfrom recvfrom
  49. #define x__recvfrom   __recvfrom
  50. #define term_send     send
  51. #define x__send       __send
  52. #define term_sendto   sendto
  53. #define x__sendto     __sendto
  54. #define term_shutdown shutdown
  55. #define x__shutdown   __shutdown
  56. #define term_socket   socket
  57. #define x__socket     __socket
  58. #define term_strerror strerror
  59. #define x__strerror   __strerror
  60. #define term_vfork    vfork
  61. #define x__vfork      __vfork
  62. #else /* Not SHAREDIR */
  63. /* These are to rename the original libc.so.4 functions when including them in */
  64. /* libt.so.4 */
  65. #define accept          __accept
  66. #define bind            __bind
  67. #define chroot(x)       __chroot(x)
  68. #define connect         __connect
  69. #define close(x)        __close(x)
  70. #define dup(x)          __dup(x)
  71. #define dup2(x,y)       __dup2(x,y)
  72. #ifndef linux
  73. #define fcntl           __fcntl
  74. #endif
  75. #define fork()          __fork()
  76. #define gethostbyname   __gethostbyname
  77. #define gethostbyaddr   __gethostbyaddr
  78. #define getpeername     __getpeername
  79. #define getsockname     __getsockname
  80. #define gethostname(x,y) __gethostname(x,y)
  81. #define listen          __listen
  82. #define perror      ___IO_perror
  83. #define _IO_perror      ___IO_perror
  84. #define rcmd            __rcmd
  85. #define recv            __recv
  86. #define recvfrom        __recvfrom
  87. #define send            __send
  88. #define sendto          __sendto
  89. #define shutdown        __shutdown
  90. #define socket          __socket
  91. #define strerror    __strerror
  92. #define vfork()         __vfork()
  93. #endif
  94. #else /* Not BUILD_LIBC */
  95. #ifdef BUILD_LIBTERMNET
  96. /* This is for compiling libtermnet.so.2 */
  97. #define x__accept          accept
  98. #define x__bind            bind
  99. #define x__chroot          chroot
  100. #define x__close           close
  101. #define x__connect         connect
  102. #define x__dup             dup
  103. #define x__dup2            dup2
  104. #define x__fcntl           fcntl
  105. #define x__fork            fork
  106. #define x__gethostbyname   gethostbyname
  107. #define x__gethostbyaddr   gethostbyaddr
  108. #define x__gethostname     gethostname
  109. #define x__getpeername     getpeername
  110. #define x__getsockname     getsockname
  111. #define x__listen          listen
  112. #define x__perror         perror
  113. #define x__rcmd            rcmd
  114. #define x__recv            recv
  115. #define x__recvfrom        recvfrom
  116. #define x__send            send
  117. #define x__sendto          sendto
  118. #define x__shutdown        shutdown
  119. #define x__socket          socket
  120. #define x__strerror       strerror
  121. #define x__vfork           vfork
  122. #else /* Not BUILD_LIBTERMNET */
  123. /* This is for when the user ports a program to use libtermnet.so.4. */
  124. #define accept          term_accept
  125. #define bind            term_bind
  126. #define chroot          term_chroot
  127. #define close           term_close
  128. #define connect         term_connect
  129. #define dup             term_dup
  130. #define dup2            term_dup2
  131. #define fcntl           term_fcntl
  132. #define fork            term_fork
  133. #define gethostbyname   term_gethostbyname
  134. #define gethostbyaddr   term_gethostbyaddr
  135. #define gethostname     term_gethostname
  136. #define getpeername     term_getpeername
  137. #define getsockname     term_getsockname
  138. #define listen          term_listen
  139. #define perror      term_perror
  140. #define rcmd            term_rcmd
  141. #define recv            term_recv
  142. #define recvfrom        term_recvfrom
  143. #define send            term_send
  144. #define sendto          term_sendto
  145. #define shutdown        term_shutdown
  146. #define socket          term_socket
  147. #define strerror    term_strerror
  148. #ifndef vfork
  149. #define vfork           term_vfork
  150. #endif /* vfork */
  151. #endif /* BUILD_LIBTERMNET */
  152. #endif /* BUILD_LIBC */
  153. #endif /* TERMWRAP */
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.